#!/usr/bin/python

singer = []
song = []
while 1:
    print("\t1.add singer")
    print("\t2.show singer list")
    print("\t3.del singer")
    print("\t4.show song list")
    print("\t5.del song")
    print("\t6.add song")
    print("\t7.count singer and song")
    print("\t8.singer is or isn't in list")
    print("\t9.song is or isn't in list")
    print("\t0.exit")
    num = input("please input your choice:")
    if num.isdigit():
        if num == "1":
            add_singer = input("please input a new singer:")
            if add_singer in singer:
                print("the singer %s is exist!" % add_singer)
            else:
                singer.append(add_singer)
                print("add singer %s ok!" % add_singer)
        if num == "2":
            print(*singer)
        if num == "3":
            print("\t1.Del by number")
            print("\t2.Del by name")
            print("\t0.exit")
            num1 = input("please input your choice:")
            if num1.isdigit():
                if num1 == "1":
                    del_num = input("please input want to del number:")
                    del_num = int(del_num)
                    if 1 <= del_num and del_num <= len(singer):
                        a = singer[del_num-1]
                        singer.pop(del_num-1)
                        print("del singer %s ok!" % a)
                    else:
                        print("the singer is not exist!")
                if num1 == "2":
                    del_name = input("please input want to del name:")
                    if del_name in singer:
                        singer.remove(del_name)
                        print("del singer %s ok!" % del_name)
                    else:
                        print("the singer is not exist!")
            else:
                print("input error!")
        if num == "4":
            print(*song)
        if num == "5":
            del_song = input("please input want to del song:")
            if del_song in song:
                song.remove(del_song)
                print("del song %s ok!" % del_song)
            else:
                print("the song %s is exist!" % del_song)
        if num == "6":
            add_song = input("please input want a new song:")
            if add_song in song:
                print("the song %s is exist!" % add_song)
            else:
                song.append(add_song)
                print("add song %s ok!" % add_song)
        if num == "7":
            count_singer = len(singer)
            count_song = len(song)
            print("singers have %d,songs have %d" % (count_singer, count_song))
        if num == "8":
            query_singer = input("please input want to query singer:")
            if query_singer in singer:
                print("the singer %s is in list!" % query_singer)
            else:
                print("the singer %s is not exist!" % query_singer)
        if num == "9":
            query_song = input("please input want to query song:")
            if query_song in song:
                print("the song %s is in list!" % query_song)
            else:
                print("the song %s is not exist!" % query_song)
        if num == "0":
            exit()
    else:
        print("input error!")
